<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/connopen.asp"-->
<!--#include file="lib/asp-common-lib.asp"-->
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>报关单登记系统</title>
<!--#include file="lib/plugins.asp"-->
<style type="text/css">
  .ui-datepicker table {
    border: 0;
  }
  .ui-autocomplete-loading { 
    background: white url('images/ui-anim_basic_16x16.gif') left center no-repeat; 
  }
  .ui-autocomplete,.ui-menu-item .ui-corner-all {
      border-radius: 0;
  }
  thead th{
    #text-align:center;
    background:#e0e0e0;
  }
  tbody th[scope="row"],tbody th.sub{
    text-align:center;
  }
  input,select{
    border:1px solid #888888;
  }
  input:hover,input:active,select:hover,select:active{
    border:1px solid #aa6666
  }
  input[type=text]{
    padding:2px;
    margin:1px 0;
  }
  #pagebar{
    float:right;
  }
  #search_bar{
    border-width:1px 0;
  }
  #search_bar td{
    padding:1px;
    border-width:0;
  }
  #search_bar tr:hover td{
    background:#fff;
  }
  .bt_button{
    cursor: pointer;
    overflow: visible;
    width: auto;
    background: url("lib/yaml/screen/images/button_gray.png") repeat-x scroll left top #454545;
    border-color: #DDDDDD #444444 #444444 #DDDDDD;
    border-style: solid;
    border-width: 1px;
    color: #000000;
    padding: 5px 1em;
  }
  .bt_button:hover,.bt_button:active,.bt_button:focus{
    background: none repeat-x scroll left top #555555;
    border-color: #444444 #DDDDDD #DDDDDD #444444;
    color: #ffffff;
  }


  #lb_search{
    width:5.1em;
  }
  #bts_search{
    width:11.9em;
    text-align:right;
  }
/* select class */

    .sel{
      color:red;
    }
    .unsel{
      color:black;
    }
  
/* // select class */


</style>

<script type="text/javascript">
$(function() {
    $.ajaxSetup ({
        cache: false, //关闭AJAX相应的缓存
        beforeSend:function() {
            $("#search_bar .ui-widget").addClass( "ui-autocomplete-loading" );
            $("#bt_search").attr("disabled",true);
        },
        complete:function() {
            $("#search_bar .ui-widget").removeClass( "ui-autocomplete-loading" );
            $("#bt_search").attr("disabled",false);
        }
    });
    $("#fm_search").submit(function(e){
        e.preventDefault(); 
        $("#bt_search").trigger("click");
    });
    $("#fm_search select").change(function(){
        $("#bt_search").trigger("click");
    });
    $("#search_bar input[type=reset]").click(function(){
      $("#search_bar select").removeClass("sel")
        .children().removeClass("unsel");
    });
    
    $("#search_bar select").change(function(){
      //console.log($(this).find("option:selected").index());
      $sel=$(this).find("option:selected");
      if($sel.index()>0){
        $sel.removeClass("unsel")
          .siblings().addClass("unsel")
          .parent().addClass("sel");
      }else{
        $sel.parent().removeClass("sel")
          .children().removeClass("unsel");
      }
    });
    $("#bt_search").click(function(e){
        if($("#tx_search").val()!=""){
            $.ajax({
                type:"get",
                url:"http://"+window.location.hostname+":50004/hs",
                jsonp:"callback",
                dataType:"jsonp",
                data:$("#fm_search").serialize(),
                success:function(json){
                    //console.log(json);
                    //console.log(json[0].g_name);
                    $("#dv_content tbody").html("");
                    $.each(json,function(i,item){
                        //console.log(item.g_name);
                        //$("<td>").text(item.code_t+item.code_s);
                        //$("<td>").text(item.g_name);
                        //$("<td>").text(item.g_model);
                        $("<tr>").append($("<td>").text(item.code_t+item.code_s)).append($("<td>").text(item.g_name)).append($("<td>").text(item.g_model)).appendTo("#dv_content tbody");
                    });
                }
            });
        }
    });


});
</script>
<!--#include file="lib/js-google-analytics.asp"-->
</head>
<%
If Not CheckFlag(session("aaPostFlag"),1) Then Call JumpErrorPage(2)
%>
<body>
<!--#include file="lib/header.asp"-->
<!--#include file="lib/nav.asp"-->
<div id="main">

<!--#include file="lib/col1.asp"-->
<!--#include file="lib/col2.asp"-->
    <div id="col3">
        <div id="col3_content" class="clearfix">
            <form id="fm_search" name="fm_search">
                <table id="search_bar" class="full">
                  <tr>
                    <td id="lb_search">
                        <label for="tx_search">查询内容：</label>
                    </td>
                    <td>
                      <div>
                        <input id="tx_search" name="tx_search" type="text" size="40" />
                        <select id="search_type" name="search_type">
                          <option value="hsno">商品编号</option>
                          <option value="gname">商品名称</option>
                          <option value="gmodel">规格型号</option>
                        </select>
                        <select id="search_count" name="search_count">
                          <option value="500">最新500条</option>
                          <option value="0">全部</option>
                        </select>
                      </div>
                    </td>
                    <td id="bts_search">
                      <div class="ui-widget">
                      <input id="bt_search" class="bt_button" name="bt_submit" type="button" value="搜索" />
                      <input class="bt_button" type="reset" value="重置" />
                      </div>
                    </td>
                  </tr>
                </table>
            </form>
            <div id="dv_content">
                <table class="full">
                    <thead>
                        <tr>
                            <th scope="col">商品编号</th>
                            <th scope="col">商品名称</th>
                            <th scope="col">规格型号</th>
                        </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<!--#include file="lib/footer.asp"-->
</body>
</html>
<!--#include file="lib/connclose.asp"-->

